﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed
#pragma once
#include "GcmpGUiBaseInterface.h"
#include "IEventArgs.h"
#include "Any.h"

namespace gcmp
{
    /// \brief ComboBox事件类型
    enum class ComboBoxEventType : int32_t
    {
        CurrentIndexChanged    ///< 当前的index改变就会触发，无论程序修改引起还是用户手动修改引起
    };

    /// \brief ComboBox事件参数
    class GCMP_GUI_BASE_INTERFACE_EXPORT IComboBoxEventArgs : public IEventArgs
    {
        DEFINE_CAST_DERIVED(gcmp::IComboBoxEventArgs, gcmp::IEventArgs);

    public:
        /// \brief 得到ComboBox事件类型
        virtual ComboBoxEventType GetType() const = 0;

         /// \brief 得到当前item显示的文字
         virtual std::wstring GetCurrentText() const = 0;

         /// \brief 得到当前item索引
         virtual int GetCurrentIndex() const = 0;
 
         /// \brief 得到当前item设置的用户数据
         virtual Any GetCurrentData() const = 0;
    };
}

